//
//  MainCollectionViewCell.m
//  Supervisor
//
//  Created by 小宇 on 2017/5/10.
//  Copyright © 2017年 北京怀教网络科技股份有限公司. All rights reserved.
//

#import "MainCollectionViewCell.h"
@interface MainCollectionViewCell()

@end
@implementation MainCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 8.5, 75, 75)];

        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.imgView.frame) + 4.5, GetViewWidth(self), 16.5)];
        self.nameLabel.textColor = [UIColor colorWithHexString:@"#444444"];
        self.nameLabel.font = AdaptedFontSize(12);
        self.nameLabel.textAlignment = NSTextAlignmentCenter;
        
        [self addSubview:self.imgView];
        [self addSubview:self.nameLabel];
    }
    return self;
}

- (void)addTipNumLabelWithTipNum:(NSString *)tipNum{
        self.tipNumLabel = [[UILabel alloc]initWithFrame:CGRectMake(54, 8.5, 20, 20)];
        self.tipNumLabel.layer.cornerRadius = 10;
        self.tipNumLabel.layer.masksToBounds = YES;
        self.tipNumLabel.backgroundColor = [UIColor redColor];
        self.tipNumLabel.font = AdaptedFontSize(10);
        self.tipNumLabel.textAlignment = NSTextAlignmentCenter;
        self.tipNumLabel.textColor = [UIColor whiteColor];
        self.tipNumLabel.text = tipNum;
    if ([tipNum integerValue] > 0) {
        [self addSubview:self.tipNumLabel];
    }
}

@end
